#!/bin/bash

SHDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
echo "脚本路径为: $SHDIR"

sudo chown $(whoami):$(whoami) -R $SHDIR
sudo  mkdir -p /data/nginx
sudo chown $(whoami):$(whoami) -R /data
chmod 777 -R /data

# docker network create --subnet 100.0.0.0/24 --scope swarm mca-icvc-subnet || true
cd $SHDIR
echo -e "\n-----\nstop nginx service ... "
docker-compose -f docker-compose-nginx.yml down 
sleep 1
echo -e "\n-----\nstart nginx service ... "
docker-compose -f docker-compose-nginx.yml up -d 
cd -